<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template match="settings">

<xsl:variable name="sesso">
	<xsl:choose>
		<xsl:when test='@answerid="24"'>
			<tr><td colspan="2">1</td></tr>
		</xsl:when>
		<xsl:when test='@answerid="25"'>
			<tr><td colspan="2">0</td></tr>
		</xsl:when>
		<xsl:when test='@answerid="26"'>
			<tr><td colspan="2">1</td></tr>
		</xsl:when>
		<xsl:when test='@answerid="27"'>
			<tr><td colspan="2">0</td></tr>
		</xsl:when>
	</xsl:choose>
</xsl:variable>

<form METHOD="POST" name="configure" action="/userinfo/configure.aspx?userid={User/@GUID}">

<TABLE class="body" cellSpacing="0" cellPadding="0" border="0">
	<TBODY>
		<TR> 
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-tl.gif" width="8" border="0"/></TD>
			<TD width="100%" bgcolor="white" background="/imgs/pvts/box-t-back.gif"><IMG height="8" src="/imgs/pvts/box-t.gif" width="10" border="0"/></TD>
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-tr.gif" width="8" border="0"/></TD>
		</TR>
		<TR vAlign="top"> 
			<TD width="8" bgcolor="white" background="/imgs/pvts/box-l-back.gif"><IMG height="10" src="/imgs/pvts/box-l.gif" width="8" border="0"/></TD>
			<TD width="100%" bgcolor="white" align="left" style="padding-left:5px;">

<div style="height:151px;float:left;">
	<xsl:choose>
	 <xsl:when test='User/@approved = 1'>

				<xsl:choose>
					<xsl:when test="count(User/@thumb) &gt; 0 and count(User/@splash) &gt; 0">
						<center><a href="/showUserPics.aspx?userGuid={User/@GUID}"><img border="0" src="/imgs/user/thumb/{User/@thumb}"/></a></center>
					</xsl:when>
					<xsl:when test="count(User/@thumb) &gt; 0 and count(User/@splash) = 0">
						<center><img border="0" src="/imgs/user/thumb/{User/@thumb}"/></center>
					</xsl:when>
					<xsl:when test="count(User/@thumb) = 0 and count(User/@splash) = 0 and count(User/@picname) &gt; 0">
						<center><a href="/showUserPics.aspx?userGuid={User/@GUID}"><img border="0" max-width="110px" src="/userspics/{User/@picname}"/></a></center>
					</xsl:when>
					<xsl:otherwise>
					</xsl:otherwise>
				</xsl:choose>

		</xsl:when>
		<xsl:otherwise>
			<img src="/imgs/userinfo/user_foto.gif" width="168" height="134" border="0"/>
		</xsl:otherwise>
	</xsl:choose>
</div>
<div>
<table height="150px" width="210px" border="0" align="left" cellpadding="0" cellspacing="0" style="padding-left:10px;">
        <tr> 
          <td class="body10">username</td>
          <td class="body10red"><b><xsl:value-of select="User/@Nick"/></b></td>
        </tr>
        <tr> 
        <td class="body10">email</td>
        <td class="body10">
        <xsl:choose>
            <xsl:when test='((floor(User/@status div 1) mod 2)!=1) and ((floor(User/@status div 2) mod 2)!=1) '>
              nascosta, da confermare!
           </xsl:when>
           
           <xsl:when test='((floor(User/@status div 1) mod 2)!=1) and ((floor(User/@status div 2) mod 2)=1)'>
               nascosta, ancora da confermare!
           </xsl:when>
            <xsl:when test='((floor(User/@status div 1) mod 2)=1) and ((floor(User/@status div 2) mod 2)=1) '>
               nascosta, gia' confermata !
           </xsl:when>    
           <xsl:otherwise>
               nascosta e confermata !
           </xsl:otherwise>
         </xsl:choose>  
          </td>
        </tr>
        <tr> 
          <td class="body10">
                  <xsl:choose>
                     <xsl:when test='$sesso=0'>
                        iscritta dal
                     </xsl:when>
                     <xsl:when test='$sesso=1'>
                        iscritto dal
                     </xsl:when>
                  </xsl:choose>
          </td>
          <td class="body10"><xsl:value-of select="substring(User/@datetime,9,2)"/>-<xsl:value-of select="substring(User/@datetime,6,2)"/>-<xsl:value-of select="substring(User/@datetime,1,4)"/></td>
        </tr>

        <tr> 
          <td class="body10">eta'</td>
          <td class="body10red"><xsl:value-of select="User/@eta"/> anni</td>
        </tr>
        <tr> 
          <td class="body10">abita a</td>
          <td class="body10red"><b><xsl:value-of select="User/@place"/></b></td>
        </tr>
        <tr> 
          <td class="body10">disponibilita'</td>
          <td class="body10red">
               <xsl:choose>
                  <xsl:when test="User/@purity&gt;0">
                  <xsl:value-of select="format-number(100-100*(140-User/@purity) div 140,'##')"/>%
                  </xsl:when>
                  <xsl:otherwise>
                  sconosciuta
                  </xsl:otherwise>
               </xsl:choose>
          </td>
        </tr>
                <tr> 
        
					  <xsl:choose>

						  <xsl:when test='User/@isOnline &gt; 0'>

						  </xsl:when>

						  <xsl:when test='User/@llmi &lt;= 119'>
							  <td class="body10">era qui</td>
							  <td class="body10red"><b><xsl:value-of select="User/@llmi"/> minuti fa</b></td>
						  </xsl:when>

						  <xsl:when test='User/@llmi &gt; 120 and User/@llhh &lt;= 71'>
							  <td class="body10">era qui</td>
							  <td class="body10red"><b><xsl:value-of select="User/@llhh"/> ore fa</b></td>
						  </xsl:when>

						  <xsl:when test='User/@llhh &gt; 72 and User/@lldd &lt;= 45'>
							  <td class="body10">era qui</td>
							  <td class="body10red"><b><xsl:value-of select="User/@lldd"/> giorni fa</b></td>
						  </xsl:when>

						  <xsl:otherwise>
							  <td class="body10">ultimo login</td>
							  <td class="body10">
							  <xsl:value-of select="substring(User/@lastlogin,9,2)"/>-<xsl:value-of select="substring(User/@lastlogin,6,2)"/>-<xsl:value-of select="substring(User/@lastlogin,1,4)"/></td>
						  </xsl:otherwise>

					  </xsl:choose>
        
        </tr>
      </table>
</div>

			</TD>
			<TD width="8" bgcolor="white" background="/imgs/pvts/box-r.gif"><IMG height="10" src="/imgs/pvts/box-r.gif" width="8" border="0"/></TD>
		</TR>
		<TR> 
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-bl.gif" width="8" border="0"/></TD>
			<TD width="100%" bgcolor="white" background="/imgs/pvts/box-b.gif"><IMG height="8" src="/imgs/pvts/box-b.gif" width="10" border="0"/></TD>
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-br.gif" width="8" border="0"/></TD>
		</TR>
	</TBODY>
</TABLE>

<div><img src="/imgs/spacer.gif" height="10px"/></div>

<TABLE class="body" cellSpacing="0" cellPadding="0" border="0">
	<TBODY>
		<TR> 
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-tl.gif" width="8" border="0"/></TD>
			<TD width="100%" bgcolor="white" background="/imgs/pvts/box-t-back.gif"></TD>
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-tr.gif" width="8" border="0"/></TD>
		</TR>
		<TR vAlign="top"> 
			<TD width="8" bgcolor="white" background="/imgs/pvts/box-l-back.gif"></TD>
			<TD width="100%" bgcolor="white" align="left" style="padding-left:5px;">

<div style="padding-left:40px;">
<b>Status</b>
</div>
<div style="padding-left:20px;">
<xsl:for-each select="Question[@ID=7]">
<div style="padding-left:20px;padding-top:5px;">
		<xsl:for-each select="Answer">
			<xsl:choose>
				<xsl:when test='(floor( /settings/User/@status div @ID ) mod 2)'><input type="checkbox" name="ghost" value="{@ID}" checked="yes"><xsl:value-of select="."/></input><br/></xsl:when>
				<xsl:otherwise>
						<input type="checkbox" name="ghost" value="{@ID}"><xsl:value-of select="."/></input><br/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:for-each>
</div>
</xsl:for-each>
</div>

<xsl:if test="(floor( /settings/@operatorAuthlevel div 65536 ) mod 2)">
<div style="padding-left:24px;">
<xsl:for-each select="Question[@ID=8]">
<div style="padding-left:20px;padding-top:5px;">
					<select class="body" size="1" name="{@Description}">
					<xsl:for-each select="Answer">
			<xsl:choose>
				<xsl:when test='(floor( /settings/User/@status div @ID ) mod 2)'>
					<option value="{@ID}" selected="true"><xsl:value-of select="."/></option>
				</xsl:when>
				<xsl:otherwise>
					<option value="{@ID}"><xsl:value-of select="."/></option>
				</xsl:otherwise>
			</xsl:choose>
					</xsl:for-each>
					</select>			
</div>
</xsl:for-each>
</div>
</xsl:if>

<div style="padding-top:10px;">
<center><hr width="75%"/></center>
</div>

<xsl:if test="(floor( /settings/@operatorAuthlevel div 65536 ) mod 2)">
<div style="padding-left:40px;">
<b>Settings</b>
</div>
<div style="padding-left:20px;">
<xsl:for-each select="Question[@ID=6]">
<div style="padding-left:20px;padding-top:5px;">
		<xsl:for-each select="Answer">
			<xsl:choose>
				<xsl:when test='(floor( /settings/User/@settings div @ID ) mod 2)'><input type="checkbox" name="blog" value="{@ID}" checked="yes"><xsl:value-of select="."/></input><br/></xsl:when>
				<xsl:otherwise>
						<input type="checkbox" name="blog" value="{@ID}"><xsl:value-of select="."/></input><br/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:for-each>
</div>
</xsl:for-each>
</div>
<div style="padding-left:20px;">
<xsl:for-each select="Question[@ID=9]">
<div style="padding-left:20px;padding-top:5px;">
		<xsl:for-each select="Answer">
			<xsl:choose>
				<xsl:when test='(floor( /settings/User/@settings div @ID ) mod 2)'><input type="checkbox" name="photo" value="{@ID}" checked="yes"><xsl:value-of select="."/></input><br/></xsl:when>
				<xsl:otherwise>
						<input type="checkbox" name="photo" value="{@ID}"><xsl:value-of select="."/></input><br/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:for-each>
</div>
</xsl:for-each>
</div>
</xsl:if>

<div style="padding-top:10px;">
<center><hr width="75%"/></center>
</div>

<div style="padding-left:40px;">
<b>Video</b>
</div>
<div style="padding-left:20px;">
<xsl:for-each select="Question[@ID=10]">
<div style="padding-left:20px;padding-top:5px;">
	<input style="width:15em;" type="text" name="docid" value="{/settings/User/video/@docid}"></input><button onclick="javascript:window.open('http://video.google.it/videoplay?docid={/settings/User/video/@docid}');return false;"><img src="/imgs/play.gif"/></button><br/>
	<span class="shycomment">(video.google.com docid)</span>
</div>
</xsl:for-each>
</div>


<div style="padding-left:120px;padding-top:25px;">
	<input id="go" name="go"  type="submit" value="Salva le modifiche!"></input>
	<input type="hidden" name="CONFIGURE" value="CONFIGURE"></input>
</div>
	
			</TD>
			<TD width="8" bgcolor="white" background="/imgs/pvts/box-r.gif"><IMG height="10" src="/imgs/pvts/box-r.gif" width="8" border="0"/></TD>
		</TR>
		<TR> 
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-bl.gif" width="8" border="0"/></TD>
			<TD width="100%" bgcolor="white" background="/imgs/pvts/box-b.gif"><IMG height="8" src="/imgs/pvts/box-b.gif" width="10" border="0"/></TD>
			<TD width="8"><IMG height="8" src="/imgs/pvts/box-br.gif" width="8" border="0"/></TD>
		</TR>
	</TBODY>
</TABLE>

</form>

</xsl:template>

</xsl:stylesheet>